package com.taldh.design.patterns.observer.jdk;

import java.util.Observable;
import java.util.Observer;

/**
 * 观察者孙悟空
 * date 2020/5/26
 *
 * @author 袁小黑
 * @version 1.0.0
 **/

class Sunwukong implements Observer {

    @Override
    public void update(Observable o, Object arg) {
        switch ((WeatherType) arg) {
            case SUNNY:
                System.out.println("驾着七彩祥云");
                break;
            case RAINY:
                System.out.println("闪亮登场");
                break;
            case WINDY:
                System.out.println("放屁");
                break;
            case COLD:
                System.out.println("去救师傅");
        }
    }
}
